-- Localized Functions for the European Version
-- Outsorced functions:
-- _GFind

if ( GetLocale() == "deDE" or GetLocale() == "enGB" or GetLocale() == "enUS" or GetLocale() == "frFR" or GetLocale() == "esES" or GetLocale() == "zhTW" or GetLocale() == "koKR" or GetLocale() == "zhCN") then

	function CEnemyCastBar_Gfind_PvP(arg1, event) --Gfind_PvP

		local mob, spell = string.match(arg1, CEnemyCastBar_SPELL_CAST);
		if (spell) then
			if (NECB_SPELL_CAST_turnit) then
				CEnemyCastBar_Control(spell, mob, "casts", nil, event);
			else
				CEnemyCastBar_Control(mob, spell, "casts", nil, event);
			end
			return true;
		end	

		--[[
		mob, spell = string.match(arg1, CEnemyCastBar_SPELL_PERFORM);
		if (spell) then
			if (NECB_SPELL_PERFORM_turnit) then
				CEnemyCastBar_Control(spell, mob, "performs", nil, event);
			else
				CEnemyCastBar_Control(mob, spell, "performs", nil, event);
			end
			return true;
		end]] -- removed for performance reasons

		--instant casts since 6.1.2+ (PvE will load PvP anyway ;-))
		mob, spell = string.match(arg1, CEnemyCastBar_SPELL_CASTS);
		if (spell) then
			if (NECB_SPELL_CASTS_turnit) then
				CEnemyCastBar_Control(spell, mob, "instcast", nil, event);
			else
				CEnemyCastBar_Control(mob, spell, "instcast", nil, event);
			end
			return true;
		end

		if (CEnemyCastBar.bSpellBreaks) then
			local interrupter;
			interrupter, mob, spell = string.match(arg1, CEnemyCastBar_SPELL_INTERRUPTED_OTHER);
			if (mob) then			
				if (NECB_SPELL_INTERRUPTED_OTHER_turnit) then
					NECB_interrupt_casting(" ", spell);
				else
					NECB_interrupt_casting(" ", mob);
				end
				return;
			end
		end

		if (CEnemyCastBar_Gfind_PvE) then -- use func check, because of 5 sec delay if instance entered
			CEnemyCastBar_Gfind_PvE(arg1, event); --load on demand, only loaded for Naxx else NIL
		end -- only: "CHAT_MSG_SPELL_CREATURE_VS_PARTY/SELF/CREATURE_DAMAGE", registered in PvE code localization

	end

	function CEnemyCastBar_Gfind_PvP_Gains(event) --Gfind_PvP, direct call now (arg1 created)!

		local stack = string.match(arg1, "(%(.+%))");
		if ( stack ) then -- check for something in brackets, delete whole part in brackets -- number will be pulled out in control for better performance
			arg1 = string.gsub(arg1, NECB_Stack_Catcher2, "");
		end

		local mob, spell = string.match(arg1, CEnemyCastBar_SPELL_GAINS);
		if (spell) then
			if (NECB_SPELL_GAINS_turnit) then
				CEnemyCastBar_Control(spell, mob, "gains", nil, event, nil, stack);
			else
				CEnemyCastBar_Control(mob, spell, "gains", nil, event, nil, stack);
			end
			return;
		end
	end

end